home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr10 / tvprompt.zip / TV_PROMP.DOC < prev    next >
Text File  |  1992-06-02  |  6KB  |  115 lines

  1.    This is a scrolling teleprompter type program.  It uses CGA 640x200
  2. mode and is intended to be run on a CGA board with NTSC composite video
  3. output.  It is a small example of useful multitasking in Ada. It may also
  4. be a useful program for a TV studio that depends on old, cheap, donated
  5. equipment since it will run on rather old, slow CGA PCs.  Note though that
  6. not all CGA boards are compatible - some may produce excessive snow or
  7. fail to scroll properly.
  8.  
  9.                        Running the program
  10.  
  11.   To run the program type
  12.  
  13. tv_prompt [optional script file name]
  14.  
  15.   and the computer will load and start scrolling the script file.
  16.  
  17. Available keyboard controls are:
  18.  
  19. 1 to 9    digits from 1 to 9 specify speed.  1 is slowest, 9 fastest.
  20. 0 (zero) pause scrolling
  21. + (plus) scroll 10% faster
  22. - (minus) scroll 10% slower
  23. . (period) stop the program
  24.  
  25. Any other character starts a line of text to be interspersed with the
  26. script file (but white letters on black background) and scrolled.  A
  27. carriage return or hitting the right hand side (19 characters) ends a
  28. line of text input at which point it will be scrolled.  When the script
  29. file is done, the program will simply scroll white space on the screen.
  30. You can type things from the keyboard and they will be scrolled.  This
  31. might be useful for instructions to talent when there is no teleprompter
  32. script.  If you start the program with a simple 'tv_prompt' without naming
  33. a script file, it will display white space except when you type something
  34. at the keyboard.
  35.  
  36.                              Internals
  37.  
  38. Since a teleprompter is normally read from some distance it displays
  39. letters 16 pixels high by 32 wide.  They are simply blown up from the CGA
  40. BIOS letter patterns, which looks just fine from 10 feet.  This allows
  41. only 20 characters across the screen, which means words will often be
  42. broken.  The program ignores line breaks in the input file and if it
  43. finds itself breaking a word it will instead search back for a space and
  44. break on that space.  (This applies to the text script file, not operator
  45. typeins, which are presumably very short.)
  46.  
  47. If the operator types in text which is longer than one line, the program
  48. will attempt not to intermix script file and operator type in.  The
  49. algorithm is to defer reading the script file until either the operator
  50. enters a CR or the operator has not typed anything for 3 seconds.
  51.  
  52. The program consists of three simultaneous tasks:  1) Screen.Scroller
  53. keeps the screen scrolling smoothly, accepting new text as space opens at
  54. the bottom of the screen, 2) Reader.Read_File reads the script file,
  55. breaking it into short lines and feeding them to Screen.Scroller, and 3)
  56. the main program (initial task) processes operator keystrokes for
  57. commands or interjected lines of text, supervising the other tasks as
  58. appropriate.
  59.  
  60. Files
  61.   interface specifications
  62. ALTSLICE.LIB           movmem, setmem
  63. COMMAND_.LIB           get parts of original command line
  64. CRT.LIB                deal with CGA mode, scrolling 6845
  65. DOS_IO.LIB             MSDOS file IO interface
  66. LETTERS.LIB            bit patterns of letters
  67. READER.LIB             script file reader
  68. SCREEN.LIB             scroll text at variable speed
  69.   internal code
  70. CRT.PKG                deal with CGA mode, scrolling 6845
  71. LETTERS.PKG            bit patterns of letters
  72. READER.PKG             script file reader
  73. SCREEN.PKG             scroll text at variable speed
  74.   main program
  75. TV_PROMP.PKG           handle operator keyins, control
  76.  
  77.                     Note on Ada tasking syntax
  78.  
  79. This is a simple program so it uses simple tasks - no task types, dynamic
  80. creation of tasks, etc.  In this program all three tasks start running
  81. essentially at the beginning of the program.  They communicate by
  82. rendezvous:  one task calls an entry point of another and the other
  83. accepts the call.  Tasks proceed until they wish to accept calls from
  84. another task or initiate calls of another task.  During a rendezvous the
  85. caller is suspended until the callee lets it go.  Syntactically, 'accept
  86. simple_entry(parameters...);' lets the callee continue once the
  87. parameters have been passed, whereas 'accept simple_entry(parameters...)
  88. do statements...;end' lets the callee proceed only when the 'end' of the
  89. accept statement is reached.
  90.  
  91. An accepting task may execute either a bare 'accept' statement, in which
  92. case it is suspended until someone calls that entry, or a 'select ...
  93. accept ...  accept ...  delay ...  else' to allow any of several entries
  94. to be called, or a delay to expire, or it can simply proceed if there are
  95. no current callers.
  96.  
  97. A calling task proceeds until it either calls an entry of another task,
  98. in which case it is suspended until that task finishes accepting its
  99. call, or it may use a select with alternatives to call another task only
  100. if that task is immediately, or within some given delay time, willing to
  101. accept its call.  Note that TV_prompt has code to handle a Tasking_Error
  102. in case Reader.Read_File terminates (runs into EOF on the script file)
  103. between the time TV_Prompt tests if it is callable or terminated and the
  104. time TV_Prompt actually attempts to call an entry in Reader.Read_File.
  105.  
  106. I would greatly appreciate any comments and suggestions.
  107.  
  108.                  Thanks,
  109.  
  110.                  Tom Moran    BIX tmoran
  111.                               CIS 71541,3125
  112.                               2113665@MCIMail.com
  113.                               voice (408) 741-5952
  114. June 2, 1992
  115.